package com.yz.user.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yz.model.dto.user.UpdatePasswordRequest;
import com.yz.model.entity.user.User;

/**
 * Created With IntelliJ IDEA.
 * Descriptions:
 * author: Mr.Du
 * Date: 2023/12/7
 * Time: 10:59
 */
public interface UserService extends IService<User> {

    String userLogin(String username, String password);

    String userLoginWithEmail(String email, String code);

    Long userRegister(String username, String password, String email, String code);

    User findUserByUserName(String username);

    User findUserByEmail(String email);

    void getCode(String email);

    void updatePassword(Long uid, UpdatePasswordRequest updatePasswordRequest);

    void consumeAmount(Long uid, Long amount);

    void reChargeAmount(Long uid, Long amount);

    User getUserById(Long id);

    boolean updateUserCountPromotion(Long id, Integer countPromotion);

    void logout(String username);

    void updateCountPromotion(Long uid, Integer countPromotion);

    boolean checkEmailIsCurrent(Long uid, String email);

    void scheduleUpdateUserCountPromotion();
}
